
package com.luck.org.entity;

import java.io.Serializable;
import java.util.Date;

import com.luck.pf.util.DateUtil;
import com.luck.pf.util.FormateUtil;

/**
 * @hibernate.class table="SYS_DEPARTMENT"
 * 说明:企业表
 * Copyright: Copyright (c) 2010
 * 深圳**科技
 * @author zhangwenrui 2010-8-4 下午02:52:10
 * @version 1.0
 */
public class SysDepartment implements Serializable {
	private static final long serialVersionUID = -3513865835242683910L;
	private Long id;
	private String deptName;//机构名称
	private String deptCode;//机构代码
	private String shortName ;//简称
	private String deptStatus;//状态,0：停用，1：启用
	private String treeNo;
	private Long parentId;
	private SysDepartment parentDept;//所属机构
	private String deptKind;//部门性质 0:部门,1机构
	private String deptLevel;//级别 0:顶级，1：一级，2：二级,与角色的级别对应
	private String linkman ;//联系人
	private String telephone ;//联系电话
	private String email;
	private String fax ;
	private String address ;
	private String zipcode;//邮编
	private Long createdUser;//
	private Long operUser;//操作人
	private Date operTime;//操作时间
    private String remark;//备注

    /**
     * @hibernate.id generator-class = "sequence"
     * @hibernate.generator-param name="sequence" value="seq_sys_dept"
     * @hibernate.column sql-type="NUMBER(22,0)" name="id"
     * @return
     */
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	/**
     * @hibernate.property length="50" column="dept_name"
     */
	public String getDeptName() {
		return deptName;
	}
	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}
	/**
     * @hibernate.property length="20" column="dept_code"
     */
	public String getDeptCode() {
		return deptCode;
	}
	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}

	/**
     * @hibernate.property length="2" column="dept_status"
     */
	public String getDeptStatus() {
		return deptStatus;
	}
	public void setDeptStatus(String deptStatus) {
		this.deptStatus = deptStatus;
	}
	/**
     * @hibernate.property length="20" column="short_name"
     */
	public String getShortName() {
		return shortName;
	}
	public void setShortName(String shortName) {
		this.shortName = shortName;
	}
	/**
     * @hibernate.property length="50" column="tree_no"
     */
	public String getTreeNo() {
		return treeNo;
	}
	public void setTreeNo(String treeNo) {
		this.treeNo = treeNo;
	}
	/**
     * @hibernate.property length="16" column="p_dept_id"
     */
	public Long getParentId() {
		return parentId;
	}
	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}
    /**
     * @hibernate.many-to-one class = "com.luck.org.entity.SysDepartment" column="p_dept_id" insert="false" update="false"
     * @return
     */
	public SysDepartment getParentDept() {
		return parentDept;
	}
	public void setParentDept(SysDepartment parentDept) {
		this.parentDept = parentDept;
	}
	/**
     * @hibernate.property length="2" column="dept_kind"
     */
	public String getDeptKind() {
		return deptKind;
	}
	public void setDeptKind(String deptKind) {
		this.deptKind = deptKind;
	}
	/**
     * @hibernate.property length="2" column="dept_level"
     */
	public String getDeptLevel() {
		return deptLevel;
	}
	public void setDeptLevel(String deptLevel) {
		this.deptLevel = deptLevel;
	}
	/**
     * @hibernate.property length="20" column="linkman"
     */
	public String getLinkman() {
		return linkman;
	}
	public void setLinkman(String linkman) {
		this.linkman = linkman;
	}

	/**
     * @hibernate.property length="30" column="telephone"
     */
	public String getTelephone() {
		return telephone;
	}
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	/**
     * @hibernate.property length="50" column="email"
     */
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	/**
     * @hibernate.property length="30" column="fax"
     */
	public String getFax() {
		return fax;
	}
	public void setFax(String fax) {
		this.fax = fax;
	}
	/**
     * @hibernate.property length="100" column="address"
     */
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	/**
     * @hibernate.property length="10" column="zipcode"
     */
	public String getZipcode() {
		return zipcode;
	}
	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}
	/**
     * @hibernate.property length="16" column="oper_user"
     */
	public Long getOperUser() {
		return operUser;
	}
	public void setOperUser(Long operUser) {
		this.operUser = operUser;
	}
	/**
     * @hibernate.property column="oper_time"
     */
	public Date getOperTime() {
		return operTime;
	}
	public void setOperTime(Date operTime) {
		this.operTime = operTime;
	}
	/**
     * @hibernate.property length="500" column="remark"
     */
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**
     * @hibernate.property length="20" column="created_user"
     */
	public Long getCreatedUser() {
		return createdUser;
	}
	public void setCreatedUser(Long createdUser) {
		this.createdUser = createdUser;
	}
	public String getOperTimeStr() {
		return DateUtil.dateToString(this.operTime,DateUtil.patternA);
	}
	public String getDeptLevelStr() {
		return FormateUtil.getInstance().getNameByCode("p_dept_level", this.deptLevel);
	}
	public String getDeptStatusStr() {
		if(this.deptStatus.equals("1"))
			return "启用";
		else
			return "停用";
	}
	public String getDeptKindStr() {
		if(this.deptKind.equals("1"))
			return "机构";
		else
			return "部门";
	}
}
